import axios from '@/utils/axios.js'

// categories/:id/attributes
// 获取参数列表
export const getParamsList = params =>
  axios({
    method: 'GET',
    url: `categories/${params.id}/attributes`,
    params
  })

// 添加参数
export const addParam = data =>
  axios({
    method: 'POST',
    url: `categories/${data.id}/attributes`,
    data
  })

// 删除参数
export const deleteParamsById = (id, attrId) =>
  axios({
    method: 'DELETE',
    url: `categories/${id}/attributes/${attrId}`
  })

// categories/:id/attributes/:attrId
// 编辑参数
export const editParamsById = data =>
  axios({
    method: 'PUT',
    url: `categories/${data.id}/attributes/${data.attrId}`,
    data
  })
